﻿namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string filePath = @"D:\vs\code下\aaa.txt";
            try
            {
                File.Delete(filePath);
                MessageBox.Show("文件已成功删除。");
            }
            catch (IOException ex)
            {
                MessageBox.Show($"删除文件时出错: {ex.Message}");
            }
        }
    }
}